-
-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customizable components #177
Conversation
@taras this looks good to me. I have one suggestion though. From my experience, many users just have a single component definition which get different table instances passed in. Would it be simple to do something like the following: new Table(column, rows, {
rowComponent: 'myTableRow',
spannedRowComponent: 'mySpannedRow'
}); |
I don't think we should be mixing the state and renderer. We can do something like this: {{light-table table rowComponent=(component 'my-table-row')}} |
Although true, whats the difference between specifying a cellComponent and a rowComponent? Ideally, its the same concept. I just think that at this point, we are overloading the template. If you pass a component name via the table instance for rowComponent, all thats really needed inside that component is the table instance, the columns, and the actual row content. Everything else such as class names, bindings, etc, can be done on the component itself. |
@offirgolan the same thing applies to Passing With that said, it would be difficult to implement |
new Table(column, rows, {
rowComponent: 'myTableRow',
spannedRowComponent: 'mySpannedRow'
}); I'm not really sure what this offers. Why do you think this is a good idea? |
new Table(column, rows, {
rowComponent: 'myTableRow',
spannedRowComponent: 'mySpannedRow'
}); I like this approach because of the following:
As to what you were saying, I 100% understand your direction and I like as to where it's going but I dont feel like it is the appropriate time to change the structure / direction of the API. I think that we should either make all rendering decisions on the component declaration side OR on the table declaration side. Not both. |
These 2 implementations are not actually equivalent. They're not just different APIs, they're actually different in their capability. Closure component API allows to dynamically update the row when bound data changes. This is not possible with component string name API. |
Yeah I guess that's true. Lets go ahead with this implementation. Hopefully in the near future we can delegate all renderer tasks to the template instead of the table instance (i.e. ember-microstates 😜). Once documentation is added to the possible t.body components, feel free to merge! |
@offirgolan do you want me to add the |
* master: (28 commits) Use ember-cli-code-coverage for code coverage (#185) Removed ember-cli-blanket (#176) chore(package): update ember-get-config to version 0.1.8 (#184) Add scaffolding comment Released v1.4.0 Add footer scaffolding and move width into style attr (#183) chore(package): update ember-cli-jshint to version 2.0.1 (#170) chore(package): update ember-code-snippet to version 1.6.0 (#174) chore(package): update ember-cli-mirage to version 0.2.2 (#180) Customizable components (#177) Revert "Move scaffolding width to style attribute" Move scaffolding width to style attribute Update component usage docs Demo and Docs modifications (#171) Fix docs typo [FEATURE] Two-way sync between rows and model (#167) Update ember-cli to version 2.8.0 🚀 (#165) chore(package): update ember-cli-qunit to version 3.0.1 (#168) Released v1.3.1 [FEATURE] Introduce `resizeOnDrag` for column resizing (#166) ... # Conflicts: # addon/classes/Table.js # addon/components/cells/base.js # addon/components/columns/base.js # addon/templates/components/lt-head.hbs
This feature makes it possible to provide custom
lt-*
components for the body of the table and customize the behaviour on per table basis.For example:
/components/active-row.js